/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ws08;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

/**
 *
 * @author Filipe
 */
public class Files {

    public StringBuilder readTextFile(String filepath) throws FileNotFoundException, IOException {

        StringBuilder sb = new StringBuilder();
        String str;
        BufferedReader in = new BufferedReader(new FileReader(filepath));

        while ((str = in.readLine()) != null) {
            sb.append(str + "\n");
        }
        in.close();

        return sb;
    }
}
